It is well known that the output of an electrical device can be adversely affected by interference from other nearby devices and signals. Such noise can be particularly problematic when the output of the device is used to control a system over which very precise and tight control is desired, such as in injection molding machines and the like.
Over the years, a variety of processing methods and apparatuses have been implemented for filtering signals so as to improve the stability of the signal and/or reduce noise and errors that may have been introduced into the signal. A filter is basically a system or method that selectively changes the waveshape, amplitude-frequency and/or phase-frequency characteristics of a signal in a desired manner. Such filters include highpass filters, polar filters, and Butterworth filters, and can involve a number of analog electronic circuits as well as mathematical models and techniques, such as Fourier transformations.
Although filters have been developed for the processing of both analog and digital signals, digital filters have become increasingly important due to the growing popularity of utilizing digital signals as opposed to analog signals. Signals in digital form are now widely used because the signal can be easily saved and utilized in a digital computer, and because digital signal processing has become extremely reliable, efficient, and powerful. However, even digital signals are vulnerable to the effects of noise which can interfere with the analog signal and/or the signal in digital form, as well as roundoff noise that can be incurred in converting the analog signal to digital form.
Accordingly, a variety of digital filters have been developed to combat the effects of noise on digital signals. A digital filter refers to hardware or software that performs a mathematical algorithm that operates on the digital input signal to produce a digital output signal for the purpose of achieving a filtering objective. Once the analog signal is sampled periodically and converted into digital form by an analog-to-digital convertor (or ADC), the digital filter implements the filtering operation in accordance with the computational algorithm for the filter. Once the processing of the digital signal is complete, a digital-to-analog convertor (or DAC) can convert the filtered digital signal into an analog value which can again be filtered to smooth the signal and remove unwanted noise.
While digital filters can be very beneficial in digital signal processing, they are not without limitations. Such filters can be extremely complex. Typically, the input and output signals of such filters are related by complex difference equations that include convolution sums. Although computer software and/or hardware are utilized to solve these complex equations, the use of such filtering algorithms requires the computer to make a number of mathematical calculations per filtering cycle, and also requires a sizable amount of data storage capacity for storing the filter coefficients and filter data. Of similar complexity is the design of the appropriate digital filter, which requires the computation of filter coefficients by using particular methods, such as the impulse invariant method or bilinear transformation method, and the realization of the filter into a suitable structure, such as a lattice structure or cascade structure.
As can be easily understood, these complexities contribute to the disadvantages of using digital filters. The speed of a digital filter can be limited by the complexity and number of arithmetic operations that must be performed by the filtering algorithm, which must increase as filter response is made tighter. Moreover, the design and development time for such filters, especially hardware development, can be large.
At least one less complex filtering method has been developed. According to the method, anytime the input number is greater than a predetermined range, the input number would be provided as the output of the filter, and the range would be shifted to the right such that the input number would become the upper "edge" of the range (i.e., the highest number in the range). Similarly, anytime the input number would be less than the range, the input number would be provided as the output, and the range would be shifted left such that the input number would become the lower "edge" of the range (i.e., the lowest number in the range). However, whenever the input number fell within the range, the input number would not be output, and, rather, the last number output from the routine would be provided as the filter output. It has also been know to use a "shift and add" averaging routine in combination with this filter. According to this additional routine, the "n" least significant bits of the previous 2.sup.n incoming samples were truncated and the resulting 2.sup.n numbers were added to produce a new number. The number selected for "n" could be varied based upon the particular use contemplated.
While these filtering methods decrease the complexity of previous filters, they are not without disadvantages. The first method does not adequately suppress increases or spikes in the signal. Whenever a spike occurs that falls outside of the window range, the range will shift right (i.e., toward the positive direction) and that spike will become the upper "edge" of the range. However, any additional noise that is greater in amplitude than that edge will not be suppressed, and even a slight upward drift in the signal that happens to be greater than the spike would not be stabilized by the method. Due to this effect, instability and imprecision in the filter output can result. The same is true for any low points or lulls in the signal. The first low point that falls outside of the range would cause the range to shift left (i.e., toward the negative direction), and the low point would become the lower "edge" of the new range. However, any future low points that fall below this edge, such as can be caused by a drift in the signal, would not be stabilized by the method.
In addition, the "shift and add" layer of filtering can lead to imprecision and inaccuracy, as the truncating of the least significant bits can create large errors in the signal. While the precision can be increased by increasing the number of samples added, this solution slows the process significantly.
Accordingly, there is a continuing need for effective filters that, in comparison to conventional filters, require less complex hardware and/or software(and, thus, can be produced at lower cost), can operate at faster speeds (and thus can handle signals of higher bandwidth), require less storage capacity and processing time, and can be easily changed and adapted to fit a particular application. Moreover, there is a need for such a filter that provides better stability than the "edge" type of filter, such that drifts and changes in both the positive and negative direction are stabilized. In addition, an additional filtering layer is desired which provides greater precision than the "shift and add" type of filter.